//
//  UIColor+EQ.swift
//  EQQuestionBank
//
//  Created by 范伟健 on 2018/8/6.
//  Copyright © 2018年 FanWeiJian. All rights reserved.
//

import UIKit

extension UIColor : EQCompatible {}

extension EQinglan where Base : UIColor {
    
    
    /// 十六进制返回颜色
    ///
    /// - Returns: 转换的颜色
    static func hex(_ value: Int) -> UIColor {
        return UIColor(red: ((CGFloat)((value & 0xFF0000) >> 16)) / 255.0,
                       green: ((CGFloat)((value & 0xFF00) >> 8)) / 255.0,
                       blue: ((CGFloat)(value & 0xFF)) / 255.0,
                       alpha: 1.0)
    }
    
    static func hex(_ value: Int , alpha: CGFloat) -> UIColor {
        return UIColor(red: ((CGFloat)((value & 0xFF0000) >> 16)) / 255.0,
                       green: ((CGFloat)((value & 0xFF00) >> 8)) / 255.0,
                       blue: ((CGFloat)(value & 0xFF)) / 255.0,
                       alpha: alpha)
    }
    
}
